import 'package:boss/textStyle/text_style.dart';

import 'package:boss/ui/page/member/page/memberAdministration.dart';
import 'package:boss/ui/page/member/page/rechargeRule.dart';
import 'package:boss/ui/widget/image/base_image.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

import 'gradeDiscount.dart';

class MemberIndex extends StatefulWidget {
  @override
  MyMember createState() => MyMember('会员功能选择');
}

class MyMember extends BaseState<MemberIndex> {
  MyMember(String pageName) : super(pageName);

  imgExhibition(url, title, i) {
    return Expanded(
      child: InkWell(
        onTap: () {
          if (i == 0) {
            Navigator.pushNamed(context, MemberAdministration.pageName);
          }
          if (i == 1) {
            Navigator.pushNamed(context, GradeDiscount.pageName);
          }
          if (i == 2) {
            Navigator.pushNamed(context, RechargeRule.pageName);
          }
        },
        child: Container(
          height: 176.w,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              BaseImage(
                '$url',
                width: 100.w,
                height: 100.w,
              ),
              SizedBox(
                height: 23.w,
              ),
              Text(
                "$title",
                style: TextStyleConstant().normal_1_24,
              ),
            ],
          ),
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Column(
          children: <Widget>[
            Row(
              children: <Widget>[
                imgExhibition("assets/image/member1.png", "会员管理", 0),
                imgExhibition("assets/image/member2.png", "等级优惠", 1),
                imgExhibition("assets/image/member3.png", "充值/消费规则", 2),
              ],
            )
          ],
        ),
      ),
    );
  }
}
